package com.keggview.application;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import com.keggview.application.consts.Const;
import com.keggview.application.views.ElementsTreeView;

public class Perspective implements IPerspectiveFactory {
	
	public static final String ID = "com.keggview.application.perspective";

	public void createInitialLayout(IPageLayout layout) {
		// show graph editor (editor's space) visible
		layout.setEditorAreaVisible(true);
		// show tree's view
//		layout.addStandaloneView(ElementsTreeView.ID, true, IPageLayout.LEFT,
//				Const.MODUL_TREE, IPageLayout.ID_EDITOR_AREA);
		// set properties of that view
		
		// editor mode
		IFolderLayout left = layout.createFolder("folderMain", IPageLayout.LEFT, Const.MODUL_TREE, IPageLayout.ID_EDITOR_AREA);
		// show tree elements view
		left.addView(ElementsTreeView.ID);
//		// show navigation view
//		left.addView(IPageLayout.ID_RES_NAV);

		layout.getViewLayout(ElementsTreeView.ID).setMoveable(true);
		layout.getViewLayout(ElementsTreeView.ID).setCloseable(true);

		// create bottom folder for views like properties
		IFolderLayout bottom = layout.createFolder("properties",
				IPageLayout.BOTTOM, 0.80f, IPageLayout.ID_EDITOR_AREA);
//		bottom.addPlaceholder(PropertiesView.ID + ":*");
		bottom.addView(IPageLayout.ID_PROGRESS_VIEW);
		bottom.addView(IPageLayout.ID_PROP_SHEET);
//		bottom.addView(SampleView.ID);

	}
}
